#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cstring>
#include <algorithm>
using namespace std;
bool cmp(int a, int b)
{
    return (a > b);
}
int t, temp, ncase;
long long n;

int main()
{
    int countbjasjbkasdb;
    int a;
    int b;
    int c;
    int d;
    int temp = 0;
    while (scanf("%lld", &n) && n)
    {
        a = 0;
        b = 0;
        c = 0;
        d = 0;
        countbjasjbkasdb = 0;
        while (n % 7 == 0)
        {
            n = n / 7;
            a++;
        }
        while (n % 5 == 0)
        {
            n = n / 5;
            b++;
        }
        while (n % 3 == 0)
        {
            n = n / 3;
            c++;
        }
        while (n % 2 == 0)
        {
            n = n / 2;
            d++;
        }
        countbjasjbkasdb = (a + 1) * (b + 1) * (c + 1) * (d + 1);
        printf("%d\n", countbjasjbkasdb);
    }
    return 0;
}
